from fastapi import APIRouter
from .models import ResourceType
from .k8s_client import get_k8s_resources

router = APIRouter()

@router.get("/api/resources")
async def get_resources(
    resource_type: ResourceType = "pods",
    namespace: str = None
):
    return {
        "resource_type": resource_type,
        "items": get_k8s_resources(resource_type, namespace)
    }